#include "QrLoginWidget.h"

#include <QVBoxLayout>

#include "ServerComboBox.h"
#include "StartupDlg.h"

QrLoginWidget::QrLoginWidget(StartupDlg* p) : QWidget(p), m_loginDlg(p) {
  QVBoxLayout* layout = new QVBoxLayout(this);
  layout->setContentsMargins(0, 0, 0, 0);
  layout->setSpacing(0);
  layout->setDirection(QBoxLayout::Up);

  m_sc = new ServerCombox(this);

  m_sc->setFixedSize(240, 24);
  m_sc->addItem("上海服务器组一");
  m_sc->setItemData(0, false, Qt::DisplayPropertyRole);
  m_sc->setItemData(0, Bad, Qt::DecorationRole);

  m_sc->addItem("上海服务器组二");
  m_sc->setItemData(1, true, Qt::DisplayPropertyRole);
  m_sc->setItemData(1, Good, Qt::DecorationRole);

  m_sc->setCurrentIndex(1);
  m_sc->setFocusPolicy(Qt::NoFocus);

  layout->addSpacing(8);
  layout->addWidget(m_sc);
  layout->addStretch();
}

void QrLoginWidget::paintEvent(QPaintEvent* event) {}
